package com.aaa.springboot2.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年11月15日17:19
 */
public class HelloController {
    @GetMapping("/hello")
    public Map<String,Object> hello(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("name","AAAA");
        map.put("age",220);
        return map;
    }

//    @Autowired
//    private AliPay aliPay;
//    @GetMapping("/index")
//    public AliPay index(){
//        return aliPay;
//    }

    @Value("${server.port}")
    private Integer port;

    @Value("${student.name}")
    private String name;

    @GetMapping("info")
    public String info(){
        return "服务器的端口号:"+port+";姓名:"+name;
    }

}
